There was a nice article on the beatport tech blog. I didn't manage to find it when I searched yesterday. Basically what they suggested was applying a low pass filter to isolate the base drums, then count the most common intervals between peaks (basically some kind of transformation) and then reconstruct the BPM from there by applying a range from 80-160 or similar. Hope this gives you a rough idea.
I implemented and tested it and it worked quite well with electronic music.