There are two ways I am aware of:
"Query by humming" is a technology that the Fraunhofer Institute guys in Germany (the developers of the mp3 format) are working on. They outsourced it into a company, you can check them out at http://www.m2any.com/
Their system is workin, but depending on where you're living I'm not sure if there's a local implementation - just ask (e. g. in Germany some mobile operators have a service that you can call on your mobile when you hear a song on the radio, put the mobile next to the radio and get a return sms with the song's artist and title).
There's also "The Song Tapper":
http://www.songtapper.com/
Just tap the beat and see what's coming up. Results differ :-)
Bjoern