I'm not a dog trainer (fiencee is though, including S&R, Explosive and Police training)
From what I understand, the most important thing is to, as early as possible, get the dog to associate sharp sounds with something good. Tapping, banging and eventually droping metal food dishes. - A hollow metal ball IN a metal food dish that the dog will eat around will make a racket while the dog eats and he'll associate such sounds with good.
Next, outside, drop hard treats into a metal food dish and rattle it around, then let him eat the treat.
A Cap gun or .22 Short starter pistol fired about 30-50 feet away is a good place to start with actual gun shots. Sit next to the puppy while someone fires, while you pet and praise the dog. Immediately after each shot, give him a small treat.
Slowly move closer and closer until the dog doesn't react to you firing the starter pistol right next to him. Then start with larger calibers, again, start at 50 feet and slowly move closer.
If you're not looking for a hunting dog, you may want to teach the dog to "Heel" to your side when he hears a gun-shot. That will ensure that if you need to defend yourself, he gets right to your side and sticks with you.