So if I understand you correctly, you're asking how to teach a dog to heel and to come reliably?
First of all, there are tons of resources on the net, one of the better ones in my opinion is
http://www.clickersolutions.com/articles/
Second, I'll give hasty details for a good recall.
Step 1: Depending on the age of the puppy/dog/what it knows, start by crouching and saying the dogs name excitedly with your arms open. The moment he starts moving towards you and is just about to get to you/you know for CERTAIN he is going to come, say come and give him a treat/toy/whatever he likes including lots of praise.
Repeat step 1 many times until it becomes a habit.
Step 2: Same deal, but try and have a friend or partner participate with you whereby you ping pong him back and forth between each other. Again, always treat for coming and never say come before you know they are going to come.
Step 3: Try step 1 and step 2 in increasingly difficult situations/more distractions. Keep him on a long training lead during this period.
General rules: NEVER punish the dog for coming to you or do something he doesn't like. I.E do not say come and then put him on his leash to signify the end of playtime. Do not say come and then get angry at him. This can be difficult, but the word come is for his safety and your sanity-- if you have an issue with him/need to leave/need him for something, go and get him.
The above is very basic, there's more to it but that's the general idea. Heel is another bag altogether.