This is actually easy once you know the secret of working with the iPod as a regular device, rather than as a special auto-synchronizing device. Of course, the sync feature is one reason the iPod is so popular, but just for a few minutes, let's disable it, okay?
Plug your iPod into the target computer and launch iTunes.
In addition to the usual "Library", "Podcasts", "Party Shuffle", etc,. you should also see your iPod on the left side. Click on it to select it.
Now, along the bottom right edge of the iTunes window are a bunch of little icons: click on the one that looks like a tiny iPod. It'll bring up this configuration window:
Notice here that I do not have either of the first two selected, but rather have "Manually manage songs and playlists". That's what you want to select too.
Now, close the preferences window and go back to the main iTunes window. You should still be looking at all the songs that are on your iPod. To copy them onto your new computer, simply select all the songs by using Edit --> Select All then drag them all onto the "Library" entry in the left column.
Give it a few minutes to copy everything and you should be set to go with a restored iTunes library. Phew!
Once that's all copied over, go back to the iTunes preferences and re-enable the autosync feature if you want.
Note: Since I don't have any music I've purchased from the iTunes Music Store, I am not sure what happens with registered music when you do this type of copy. My guess is that it'll just as for you to reauthorize your computer, but perhaps someone who has tried this copying technique with authorized music can share what happens?
http://www.askdavetaylor.com/can_i_transfer_music_from_my_ipod_onto_my_mac.html