Most of my firearms are kept in a gun safe with the dehumidifier that came with it plugged in (the cord is threaded through an opening in the bottom. Additionally, I keep the long guns in silicone-impregnated gun socks. This scheme seems to work since several of my shotguns are over 20 years old and show no signs of rust.
I forgot to add that most of my cases are soft but I only keep the long guns in them (still in their gun socks) for a few days and remove them whenever I arrive or come home.