Brutal truth? Yes be hard on yourself....for letting a child bug the dog. The child has more of a mental capacity to understand that her behaviour is unacceptable. Lucky for her this is a small dog and not a big one that could easy damage her little face. Honestly - this is a human issue that has escalated now in having to teach the dog that biting is unacceptable. What were you thinking letting this happen? I say education to the child and discipline the adults around this dog which is instilling fear-like behaviour. What else is he suppose to defend himself with?
As for teaching him to be more socialized, you are on the right path by taking him out on walks and mentally stimulating him with positive things such as new smells, places and situations. This is key.
Also - going to puppy classes is an excellent idea and you will gain great tips on learning to correct the behaviour, how to divert the behaviour, reading body language and also how to interact socially with your dog. Great plan.
Just get that kid situation in control and you will see such a difference in your dog. Good luck.