It is NOT free, but that cost is part of the development and does not have a significant impact on the cost of the amplifier. They don't just slap a higher price tag on it so they can use the THX logo on the front, it actually has to pass the tests. There was a very good article on the process of amp & receiver certification in Home Theater Magazine, though I couldn't find it online. I do still have the issue at home though.
Certification means different things for different components. For amps, it only means one thing - enough power to drive a given speaker at ref SPL for a particular room size. For a receiver/ pre/pro, it means they have to have certain processing functions as well as amps that meet the amp spec.
Just because it says THX on it, does not guarantee one receiver will sound better to you than the next one, so I would not use it as a primary factor for selecting a receiver. There are plenty of great receivers and amps out there that are not THX certified.
I never use THX processing because I don't like the way it sounds with my setup.