I think the Garmins do it...

taking distance traveled over altitude gained? (trying to remember math)...they do it for you I think...

Also, I saw this thing on some website, I don't remember where I found it but you attach it to your bike and it tilts in some way (or something) to let you know the grade....I'll do another search and see if I can find it.