The problem I see is that the dll library won't know anything about your form and its controls, so any direct reference to a control (such as the memo) from within the DLL will lead to compiler errors.
If you keep it to simple variable types, you could pass properties of your form's controls as command line parameters of the functions within your dll.
if within the dll, you have a function called...
function lettercount(s : string) : integer;
...you could call that dll's function and pass it the contents of your memo like this...
n := lettercount(memo.text);
In this way, the contents of your controls could be passed into the DLL, (but the controls themselves cannot).
Hope this helps.
Peace,
Colt. If it's stupid but it works, it isn't stupid