there is no authorized way to get anything synced from one computer/mac to another using the iPhone/iPod/etc. There are third party software solutions available, but I am not sure if we are allowed to talk about them on the forums.
Not a problem, when as in this case, the op is attempting to get their own music onto a new computer or maybe had a drive die and replaced it, etc.
I just have enough computers and backups, I've never had the need to transfer that stuff off one of my iDevices and so haven't kept track of the few apps most recommended for this.
There are plenty of posts here recommending apps, should be able to find a few using the search function here in the forum.
Is a problem when the an op is trying to move a "friend's" music (basically pirating) onto their computer. And prefer recommendations to be one of the "real legitimate" Mac developers apps, not one of those companies that has 10 different apps that all do the same thing essentially and whose primary advertising comes through spamming forums.
(Home Sharing is a great way to sync an iTunes library from one machine to another though.)