To do something madly is to do it in a frenzied or crazy way. If you oversleep, you might throw your clothes on and run madly out the door to catch your bus.
If your sister has a demented, angry expression on her face, you could say that her eyes are glowing madly. If your brother is rushing around the house, trying to hastily clean it up before your parents get home, you might say that he's madly throwing things in the garbage. Madly sometimes also means "intensely" or "excessively." In Shakespeare's famous play, Romeo and Juliet love each other madly.