I was doing some tests, and noticed that mIRC wouldn't let go of one test DLL, even after /dll -u. $dll(0) returns 0, but the file stays locked.

I've never encountered it before with anything else, so it probably has something to do with DllExport and VB.NET combination. I'd still assume this is not intended behaviour.

[Linked Image from i.imgur.com]

The only function the DLL has is HelloWorld, which returns "HelloWorld".

Code
Imports System.Runtime.InteropServices
Imports System.Text
Public Class HelloWorld
    <DllExport(CallingConvention.StdCall)>
    Public Shared Function HelloWorld(ByVal mWnd As IntPtr, ByVal aWnd As IntPtr, ByVal data As StringBuilder, ByVal parms As StringBuilder, ByVal show As Boolean, ByVal nopause As Boolean) As Integer
        data.Clear()
        data.Append("Hello World!")
        Return 3
    End Function
End Class