I'll explain it like I like to do it.
First you need a leg:
now you need an inverse foot, its built in the 'opposite direction',
starting with an 'imaginary' lowerankle (I call this inv_foot)
make sure that the distance between the individual joints matches the
original leg, I made both with gridsnap on, so it was simple, you could
also use vertexsnap whn you make inv_toe,inv_ball and inv_ankle and snap
them to the original joints, then move them down a bit afterwards so they
are easy to select.

Next you need to put ikhandles on your 'real' leg and foot:
Here I used a SC (Single Chain) solver, but you might aswell use a
RP (RotatePlane) solver, in fact this would give you much more control
of then legs movement, especially the knee.
It goes from the 'hip' to the 'ankle' 

Next create a SC ik handle from the 'ankle' to the 'ball'  
Then a ik handle from the ball to the toe.
Now the leg and foot is completely controlled by the 3 ik handles 
Now the inverse foot get into action, to make this work you need to
constrain each of the ikhandles in turn to its corresponding inversefoot
joint.
First select the joint to constrain to #1 (in this example the inv_toe
joint)
Then select the ik handle to constrain #2. 

Then do a Constrain>PointConstrain.
The result should look like this. 
Repeat this for the final two ikhandle/joint pairs:
Now the setup is actually finished, the i just move the inverse_foot up a bit to make the foot 'lie' flat on the ground (xz plane):
Now test the setup:
you can rotate the inverse_foot  
you can rotate the inverse_toe  
and finally you can roate the inverse_ball.
NOTE!

I usually turn on the SelectionHandle for the inverse_foot
Then I go into component mode and selects the handle
Then I move it a little 'out' and down to make it easy to select the
inverse_foot node
Then sometimes I do this for the inverse_toe and inverse_ball, aswell
, and simply do animation by keyframing rotation.
This gives good flexibility (you can make the foot flex etc.)
Other times I setup two extra attributes on the inverse_foot node, a
toeroll ans ballrool attribute, then I use 'SetDrivenKey' to let there
two control the roll (rotation) of the twon nodes, this has the advantage
that all foot animation happen on the inverse_foot node. But is slightly
less flexible.