How to get a dog to come when called is probably the most abused command in the animal world. Most people don't even realize how much so.
You never want your dog to fear to come to you so don't use the command if you are about to scold your dog for something else. Only get your dog to come to you with the "come" command if you are about to do something with your dog that they will enjoy. You don't want your dog to associate the command with fear of being punished. Remember, it is important that your dog have a trust and comfort level with you. When you are disciplining or scolding the dog, you should go to them and not say the word "come".
A dog can be like a man in the aspect that the best way to their heart is through their stomachs. When teaching a dog to come when called, you should make sure they are hungry. It is best to start at their feeding time (again, remember structure in a dog's life is important). Stand about five feet away from your dog in the beginning with their food bowl in hand (dry food is best to start this training process) or you can use a dog treat too. In intervals, move further away from the dog each time. I think it's best to start at meal times though. This should be around the same time each day and in a routine. When your dog comes over to get the food, praise him. Use an excited tone and pet them than put the food down for them to enjoy. I can't stress the importance of tones of voice when it comes to training a dog to come to you (or any type of dog training for that matter). They need to hear when you're happy with them and when you are not.
Another great way train a dog to come is to play the very basic game of hide and seek with them. Hide from your dog and yell the "come" command from where your dog can't find you. Dog's are like kids in that aspect as well. They are going to come look for you. This needs to be made fun for your dog. When he/she finds you, reward them with a treat or praise or both. Again, remembering to keep your voice very positive. The "come" command always needs to be associated with positivity.
Remember, never tell your dog to come to you if they are being scolded for something or if you are taking them somewhere they might not associate with positive (such as the vet). You don't want your dog to think that you are telling them to come and than they get into trouble or have an unpleasant experience.