The U.S. Treasury, as manager of the $700 billion Troubled Asset Relief Program, relies heavily on law firms, banks and financial companies for services and advice.

How heavily? As of July 31, Treasury spent more than $510 million for legal, banking and financial services alone. That's a big haul for the lawyers, asset managers and accountants with contracts under the program Congress created in October 2008.

Some of the biggest payments went to Fannie Mae and Freddie Mac to administer the home-mortgage modification programs. Treasury paid Bank of New York Mellon Corp. to act as custodian for securities acquired by TARP, and AllianceBernstein Holding LP to manage the program's assets.

And some of the $510 million was funneled to dozens of law firms, including Cadwalader, Wickersham & Taft LLP, which advised Treasury on the auto bailout.

(Paula Dwyer is a member of the Bloomberg View editorial board.)