Most of the time the smell is rotting food. but it is not necessarily coming from the disposal it's self but from the hose that comes from the Air gap.
The Item in the center of this picture is the air gap. The blue green item on the right is what The air gap looks like this from under the sink.
Two hoses hook up to the ends of this air gap the small one is connected to the dishwasher the larger is connected to your garbage disposal. The large hose that ties into the garbage disposal gets full of sludge from the food you put into the disposal and it rots there.
The solution to this problem is to remove the hose from the air gap and the disposal (just loosen the hose clamps and pull) clean out the hose or replace the hose. Use Bio-Clean and follow the directions
Many local codes require this air gap, if you don't have one or are not required to have one, make sure the drain hose for your dishwasher is pushed up as high as it goes behind the sink in the sink cabinet, otherwise your dirty water from your sink will drain into your dishwasher.