Let him bluff you (fold) when you have no-pair-no-draw, even if you think HE is bluffing. Check-call all draws that don't have showdown value if they miss. "Showndown value" is defined as having king-high or better. Pound him back with top pair or better. Never fold any pair and most ace-highs.
Some people feel the need to "out-bluff" maniacs, and that's a mistake. You want to out-value maniacs, meaning forcing them to put in the most bets when you're ahead, and the fewest when you're behind. There's no harm in letting him bluff you a few times. You'll get that money back (and more) when you actually hit a piece of something.
You also need to avoid slow-playing maniacs. Therefore, you should play middle pair on the flop the same way you would a set. The only difference is that you will eventually slow down on the turn with the middle pair, whereas you'll keep firing with the set! Don't slowplay huge hands against maniacs, because you will be giving up lots of value, and the maniac may actually slow down if he thinks you're slowplaying! If you go to 4 bets on the flop (in position) with middle pair, he is likely to give you 4 bets on EVERY STREET if he has something like top pair or 2 pair against your set or better. This is because he will think that YOU are willing to raise him back with light holdings, and therefore he won't give your huge hands the respect they deserve!
Now, how do you handle games with several maniacs? In those cases, you need to tighten up some pre-flop, and then pound your hands hard post-flop if you hit. Remember not to go TOO crazy with hands like top pair (if encountering re-raising), because SEVERAL maniacs increases the chance that one will hit something freaky on you (such as a weird 2 pair or straight). At the same time, you can't play scared, or you will be giving them better odds to suck out on you. It's a balancing act. It's FAR easier to play against one maniac than several. This is why my "dream" lineup of opponents would include 2 passive limp donks and 3 tight, straightforward players.