I was at a LGS, where the sales guy was trying to tell me the Suggested Retail price is typically only about 10% above their cost.
10%-15% above their actual cost is about common. MSRP is usually a LOT more than 15% above cost and very few guns are actually sold at MSRP.
There are other ways dealers can make a profit. Often a distributor will offer a special deal. I've see things like giving the dealer a Rossi revolver for every 3 Colt 1911's they buy. For big dealers who might buy 50-100 guns at a time deals like this make a difference.
Most of the profits are on accessories, but that is true in almost any buisness from cars to computers. Depending on the item profits could easily be 300% or even much more.
Used guns are a lot harder to figure, and it varies with dealers. One LGS owner does not want to deal with trade ins. If you bring one in to trade he tells you up front he does not want it and will offer by far the least trade value of anyone I've ever seen. But he prices them cheap to. They move out fast when he gets a used gun.