One such company is the a-little-too-on-the-nose-ly-named Cybergun, which not only cuts deals with manufacturers such as Uzi, Kalashnikov, and Colt to be able to use the likenesses of their weapons for airsoft products, but also acts as a middleman between those companies (among others) and the video game industry. Yes, the weapon being held by Xx_4NUSM4ST3R_xX as he teabagged you online was probably the result of intense lobbying and negotiation.
Perhaps because they know that helping to peddle weaponry to kids is a bad look, game developers don't like to talk about the specifics of this practice or the deals they cut. The gun manufacturers, though? They love bragging about how much their sales go up after they manage to negotiate a spot in, say, Call Of Duty. They also get to control every aspect of how their guns are portrayed in the games, like who uses them ("good guys" only) or how they're used (realistically). Those two requirements seem somewhat contradictory to us, but what do we know.
While it isn't easy to figure out the extent to which gun-containing video games boost real-world gun sales, that isn't really the reason gun companies are doing this. In the words of a Barrett Rifles rep, "video games expose our brand to a young audience who are considered possible future owners." That's a rather unfortunate sentence for the maker of a semiautomatic rifle to say in America, but to be fair, it had probably been entire days since the last school shooting when he said it.