You can use negation:
//*[@id="mydiv" and @class!="exclass"]
If the class
attribute may not exist on all nodes, you need this:
//*[@id="mydiv" and (not(@class) or @class!="exclass")]
The last (somewhat) odd logic can be turned into what Michael proposed:
//*[@id="mydiv" and not(@class="exclass")]
Though, personally, the fact that XPath cannot make comparisons if the attribute is missing feels a bit like a shortcoming.