The most likely source of the foul smell is your condensate tray. When you're air conditioning is operating, the coil, which sits in the ductwork above you furnace, gets very cold. The warm moist air in your house, passes over the coil, where it is cooled. The byproduct of this cooling is condensation on the coil. The condensation runs down the coil and is collected in a tray. The tray is connected to a plastic drain line or hose which usually runs to a floor drain.
In all likelihood, the condensate tray is incorrectly sloped or the drain is plugged, so that there is standing water in the tray. Bacteria and mold form in the tray. The odors from the tray permeate the house when the air conditioning is running. With the air conditioner operating, check to make sure that water is draining through the condensate drain line. If it is not, remove the line and attempt to remove the blockage with a straightened coathanger or similar object. Alternatively, there may be an access panel in the ductwork above you furnace. With the panel removed you may be able to see the condensate tray and determine whether there is standing water in the tray. You mentioned that when you turned the air conditioning off, the smell went away. What is unclear is whether you left your furnace fan running. If you didn't, the problem could conceivably be elsewhere -- smelly, stagnant water in a humidifier, or even something as obscure as a dead mouse and the ductwork. If, on the other hand, you shut off your air conditioning, and left your furnace fan running, the problem has to be related to your conditioning, and therefore must be associated with the condensate tray.