I am controlling a motor shield from the Mega. If I have the USB cable connected, it works fine, without it, I cannot control the shield. The control signal comes on momentarily, but nothing happens.
The shield has a 9V power source, which is also connected to the Vin pin on the Mega.
Do you have a link for the shield? Is it an original mega or a clone (link please)?
It's in general a bad idea to power motors and relays from the same power supply as the micro controller.
At the moment that you apply power to a motor (or relay), it will initially draw an (theoretically) infinite current causing you're voltage to drop resulting in a reset of the micro controller. So you need a rock solid power supply that is able to deliver that initial current without problems. Use a car battery might solve the issue
Easiest is to use 2 power supplies (one for each board) and not connecting the Vin pins.
Is that 9V power supply a 9V battery of the type found in smoke detectors?
If so, that's not adequate for powering motors, and barely adequate for powering just an Arduino on it's own.
What motor(s) do you have connected?
It sounds to me like you have not got a common ground in the circuit and the USB lead is accidentally completing the circuit for you.
Post a clear photo of what you have and a schematic of how you wired it up.
I bought the Mega brand new in its original packaging.
I thought it might be the power supply that is not strong enough. The motors are 3W pump motors. The power supply is an AC/DC converter, 220V AC in: 9V 1A DC out.
Let me power the Mega on its own and test the results.