He's doing this because he's 3 and immature. He can't calm himself down because he doesn't know how. You can help him calm down and thus begin teaching him how to calm himself down. He'll not be able to calm himself totally by himself for quite awhile tho.
As Hazel W. suggested, his room is a good place to go when he's being wild. Take him there and get him started on a quiet activity. Perhaps put on some music, hold him and talk quietly,or as JoAnn C. suggested quietly read to him until he's calm.
It might be a good idea to have him already in his room when company arrives. That way he misses the increased energy created by greetings.
When you visit at someone else's home talk with him ahead of time about how you expect him to behave. When you notice that he is starting to get a bit wild, stop him, hold him, perhaps take him to another room or go for a short walk outside. Interrupt him with a quiet activity before his energy gets going full force.
My grandson responds well to take a favorite toy and/or lovey with him to visits. IF your son has something with him you can bring his attention to the toy or lovey which could help him calm down. I liked to take paper and markers with me when I took my granddaughter visiting. She settled down when she could draw pictures.
One likely reason for getting wild is to get attention. Here are these people smiling and having fun and he wants to be a part of it. I've found that giving children lots of attention at the beginning helps them be able to then go off and play on their own.
If you can remain calm while you intervene you're more likely to get your son to calm down. Give him some quiet attention getting everyone to notice him and then distract him with a quiet activity.