Wikipedia has a good overview of how to develop siddhis:
http://en.wikipedia.org/wiki/Siddhi
It’s pretty straightforward how to do it. Concentration, meditation, samadhi are the three steps; all of them used together is called samyama. This last stage is what triggers the development of siddhis, which for practical purposes means you can do anything you want.
Now the question arises if these techniques work, and they have been around for a very long time, where are the people who can levitate, rule over others, have such extreme abilities?
In yoga it is often advised to skip pursuing siddhis as they distract one from achieving enlightenment. Yet it is hard to believe that no one in 2000 years would choose to spend a few centuries playing at being a demi-god on the planet Earth as a brief detour on the path to enlightenment. There is no record of this, though. So is it like so much of yoga, clever exercises to stimulate a hash-fueled fantasy?
The evidence is clear. From a factual view of the world these stories are nonsense and the exercises in developing siddhis are nothing more than devices to stimulate imagination, not to actually alter oneself or the world.
Unless there are some very subtle masters of mind and reality living quietly in the world… and siddhi development, always, by necessity, fosters non-attachment and a desire for privacy.