The easiest way to transfer all music and playlists into iTunes on your computer is to perform an Auto Transfer which will do it all for you in a single transfer. This will also include information about your favorite tracks (the play counts and star ratings for each one).
To Auto Transfer everything, just click on the drop-down menu in the lower right corner and choose Auto Transfer. Then, in the confirmation window, click on Start Auto Transfer.
Here's an additional tutorial: