Here are a couple of links that discuss crank length. The "Kirby Palm Method" http://www.nettally.com/palmk/crankset.html
suggests that i ride 180mm cranks. I have an 84 cm inseam. That sounded long to me but I experimented with it for a couple of months and i found that my power output was increased but my useful rpm range was reduced. i.e. They felt more efficient from about 85-92 rpm but less efficient when pedaling faster than 92rpm or slower than 85rpm. This was better for climbs and time trials because it is easy to stay in that narrow range. However, in mountain bike races, criteriums, and road races I found I was using more rpm range to respond to the constant accelerations and changes in pace. I am now using 175mm which corresponds roughly to the "Gallic Coincidence Factor" http://www.cranklength.info/cranks.htm
for my leg length, and I find them to be a good compromise. (I had been using 172.5 for years.)
Neither of these formulas takes into account riding style (spinner or gear masher) which is probably related to your fast-twitch/slow twitch muscle fiber ratio and your aerobic capacity, so they are a good place to start but certainly not the definitive word on crank length. Also, it has already been mentioned but femur length is actually a more important factor than leg length in determining crank length but I think femur length is quite difficult to get an accurate measurement for.
If anyone is interested in the relationship between foot speed and crank length I made a simple spreadsheet that displayed foot speed at different rpm with different length cranks. I can try to post it, but I have never tried to attach an excel file before so I don’t know if it will work.