For long guns buy a good case like a Pelican, handguns need to be in a locked container in your checked bag. Each airline has there own policies for ammunition storage and amounts.
When you check in at the counter let the person know you need "declare a firearm", not "i have a gun". They will give you a form to sign that says you certify all firearms are unloaded. They will ask you the case so they can see there is no ammo and place the declaration in the case. Depending on which airports, terminal, airline, etc you may be sent to TSA for them to inspect.
On the other end it usually comes out with the regular checked baggage.
Imagine the times i flew out of Boston post-911 with a hard case full of machine guns, suppressors, and handguns. Good times.