If the referee has indeed misunderstood your work, you have to ask yourself why he or she did so. In a rare case, the referee may have made an important mistake. If the editor saw the mistake, he will deal with this issue in his editorial letter. Sometimes, the referee makes an important mistake and the editor does not notice it. In this case, the best course of action is to inform the editor of the situation.
Nothing is gained by using vituperative language.
I just received a referee's report. The referee is not an idiot. If you received a letter inviting you or allowing you to resubmit the paper, you should decide whether you want to follow that course of action. Typically, you will have received an editorial letter telling you the conditions under which you can resubmit the paper. Sometimes you will have very good reasons not to incorporate a specific comment.