That fixed it, still kinda seems silly that after it unloads the dll it still thinks it has it and tries to access it without reloading it.
That
would be silly, which is why mIRC doesn't do it.
Your DLL is likely doing something that results in it being called upon by Windows or another external application (subclassing a window, for example). Your DLL should clean these things up when it's being unloaded.
You seem very eager to blame mIRC for what is very likely your own bad coding.