On a first look everything looks alright. You just don't need to open the .dll explicitely, i.e. you can delete the line with dll_open and the declaration of the handle when the .dll file is in the plugin folder. Other than that you should cast the numbers ot fixed (or var which is the same) before you pass them to the dll function:
a = ldexpc((fixed)1,(fixed)2);