Create a new thread from your DLL, using _beginthread (or CreateThread, if you've excluded the C run-time library from your project), store it's handle somewhere and return.
You will possibly want to create some flag (a global variable, or Event) which would indicate that the "worker" thread should terminate. In your UnloadDll function, set the flag and wait for the worker thread to exit (using WaitForSingleObject).
Remember not to use the single-threaded version of the C run-time library.
Call the SendMessage function to notify mIRC of an incoming event. Since you create an additional thread that can conflict with other DLLs accessing the file mapping, use the "mIRC_SendMessage" mutex for synchronization.