A good way to clean the dehumidifier is by cleaning the filter and catch basin with bleach and water.
The bleach will help kill off the mold which is causing the musty smell.
To prevent the musty smell from happening periodically clean the filter and basin and other parts of the dehumidifier with bleach and water before it gets too bad.