As your legs swing out of the water, they should be tucked so that your knees are at a right angle (the same position your legs are in when seated in a chair).
You may lose momentum at this point, not able to finish that last essential heels-over-the-head segment that will get your feet planted on the wall and prepare you for blast-off in the opposite direction. The solution? Use your arms! Given that they are both at your side as you flip your body over, use them from below the elbow to scull, or push, water up toward your face. This will propel you that last bit around and get you in position for pushing off the wall.
After a few tries, you should be able to plant your feet on the wall with your legs bent at the knees (again, as if you are sitting in a chair). If you do everything correctly, your face should be facing the ceiling, about a foot below the surface of the water (so remember to blow air out your nose!).
However, if you push off the wall in this position, you will end up surfacing on your back unless you rotate your body during your push-off. As you are thrusting yourself off the wall, begin turning yourself to face the bottom of the pool, face down. Rotate enough so that you surface on your stomach and resume swimming freestyle without a hitch.
Assume the Streamline Position
As you ride the momentum of your leap off the wall, stretch out your arms while tucking them behind your head in a streamline (or diving) position, elbows locked, hands on top of one another and positioned into an arrowhead. The more aerodynamic you are in the push-off, the more speed you will retain in this most vital (read: fastest) part of your lap. As you feel yourself slowing down, begin taking a stroke with your right arm, then your left, and resume swimming.
You should hold your breath in the first segment of your turn, as you tuck, roll, and plant your feet on the wall. If you don't know how to hold your breath without getting water up your nose, gently exhale through your nose while you flip over. As you push off the wall and rotate in the final step of your turn, exhale more aggressively (you want your lungs to be relatively empty so that by the time you take your first breath, post-flip, you can intake the maximum amount of fresh air).
One thing that is important to remember is that while the above list may sound extremely non-fluid and impossible to execute quickly, with practice it will eventually all flow together. Elite-level swimmers flip in less than a second, and you will soon find your own ways to cut corners and simultaneously do the required elements so that they seem fluid and natural.
It's akin to juggling, which is difficult until something clicks and you can suddenly do it with your eyes closed. As you think about the separate elements of the flip turn less and less while familiarizing yourself with the motion more and more, you will suddenly find yourself flipping out and impressing those wanna-bes in the next lane over!