Removing mold or mildew can be very difficult. Mildew and especially mold can have serious health effects and should be taken seriously. These steps will help get rid of a mold or mildew colony, but we cannot guarantee they will completely eradicate the problem. If you cannot get rid of the growth, please get rid of your mattress.
First, take mattress outdoors. Direct sunlight will help kill mold and mildew. Brush the affected area with a broom or brush to remove loose spores, then use a vacuum with a HEPA filter to remove any remaining loose spores. Be sure to wear gloves, eye protection, and breathing protection when doing this (ideally an N-95 respirator, available at hardware stores).
Next, sponge lightly with a solution of detergent and warm water, then dab with clean water and allow to dry in direct sunlight or with a hairdryer. Avoid touching moldy items with your bare hands.
If you can, apply either hydrogen peroxide or bleach (diluted with water to whatever strength you feel comfortable with) directly to the affected area (a paintbrush works well for this), then let it dry in direct sunlight or with a hairdryer.
A final vacuuming after the bed is completely dry is a good idea - even dead spores can cause allergic reactions.