Use a program called senuti:
http://www.fadingred.org/senuti/
it will take the music from the ipod and put it on the imac.
It probably won't list them in your iTunes but you can always Select from the File Menu "Add to library"
actually yes it will list them in iTunes I just recently used this with my new MBP just click on your iPod on the program highlight all the songs and drag them into gthe "library" they will then process and then put them into iTunes, while they are processing you will not see them in iTunes but once it actually starts to add them you will.
I only came across one problem, the first time I tried it the program unexpectedly failed at about song 250... but then I tried it again and over 5000 songs transferred perfectly ratings intact and everything.