I just got reminded that in 2006 I wrote an article about creating DLLs with Delphi in the Delphi Wiki.
Unfortunately I got that reminder because somebody (again) vandalized it. He probably thinks he is a l33t h4x0r for being able to edit a website. I think he simply is a [enter your favorite swearword here].
But I reverted his changes and read through that article again. It’s still correct nowadays even though it should probably be updated to mention Unicode, WideString and PWideChar.
There is also a nice article by Rudy Velthuis DLL dos and don’ts.