Under the Federal law, you can legally transport a firearm from a state where it is legal to another state where it is legal, even if you go through a state where it is not legal. But that involves a gun that is unloaded and not in reach of anyone in the vehicle. Further, in some states (NY, NJ) if the gun is found you will be arrested and you can tell the DA all about the federal law because the police have been told to make an arrest, regardless. In MD if the gun is unloaded and out of reach, you should be OK, but again a police officer may see it differently.
As to having a loaded gun on your person, or in the car and in reach, no law protects you in most states if you don't have a CCW for, or recognized in, that state. In reality, if you exercise discretion, don't violate laws (speeding, etc.), don't shoot at cop cars or give the radar cop the finger, you can probably get away with carrying about anything, but you will be taking a risk. That will be your choice.
P.S. In spite of other advice, ranting and raving about your "rights" and screaming to a cop about the Second Amendment will be more, not less, likely to earn you a trip to a motel with bars.
Jim