There are a few ways to go with this. I don't have a dog, but I have a friend who did, and I took part in making sure the dog doesn't bark.
The first thing you should do is punish the dog when it's barking at others. My advise will be to spray with a spray bottle. Yes, it's mostly used for cats, but it works on dogs, too.
DON'T YELL AT YOUR DOG!!! I cannot stress this enough!! If you yell, it's like you're barking with it.
Your dog must get some sort of reward out of barking, or it wouldn't bother. Figure out what it gets in return and remove it.
Occasionally reward your dog when it doesn't bark. Animals learn much better by getting rewarded when they do something good, than getting punished when they don't.
Ignoring the barking will definitely help. If, when you invite someone over, you inform them about your dogs behaviour and ask them to ignore it, it just might help.
You can teach your dog a trick, the quiet command. Tell your dog to speak, and when it does, three or four times, stick a treat in front of it. When it quiets down, give it the treat.
Repeat this until your dog starts barking as soon as you say speak. Then, start saying quiet, before you give it the treat. Eventually, they'll learn to be quiet when you say the word.
I hope this helps!! Good luck with your dog!