Phase 1. Building shoulder strength and balance.
There are really two parts to this. First, getting used to being upside down can be quite a chore for the uninitiated. Second, developing the upper body strength to hold your legs balanced and your body straight is the hardest part.
So devote several weeks to building up your upper body (shoulders and lats) and core strength. For shoulders you shoulder definitely include chin-ups, shoulder presses, reverse rows, and shrugs in your routine. For your core try including some challenging exercises like one-legged squats and wood choppers (cable or weighted ball).
Also, start assuming the position so to speak. Find a good wall, tuck your head and push your legs up letting your hamstrings come to rest against the wall. Hold that position for as long as you can. Please, try not to break your neck.
Phase 2. Modified Handstand Push-ups.
Assume the position (hands on the ground, head tucked) and let your hamstrings come to rest against the wall. Do as many reps as you can. When you can do 12 repetitions move on to Phase 3.
Also, stick with whatever exercises you are using to build strength in your abs and core.
Phase 3. Handstand Push-ups.
This go around, when you assume the position try to keep your hamstrings off the wall and let only the heels of your feet touch the wall- just for balance. When you feel comfortable start using only one heel, lightly pressed against the wall, to maintain your balance. And the last step removing that one heel from the wall and going straight up and down, no part of you touching the wall.
It will be a long hard journey. For many of you it might take a few months, for the more gifted about 6-10 weeks. Keep working at it.
When you get really good I challenge you to try doing these and chin-ups back-to-back. Enjoy!