Once you have created an ESP function and linked it into a DLL, register it as an ESP in a database, which lets users execute the function as an ESP.
To register an ESP, use either:
The Transact-SQL create procedure command, or,
sp_addextendedproc.