main.pp:

Install Free Pascal:

sudo apt-get install fp-compiler
Compile: (Ignore any warning about missing a -T switch. It's supposedly a linker bug.)
fpc main.pp -omainp
Run:
./mainp
Uses dynlibs; {LoadLibrary, GetProcAddress, FreeLibrary}

Var
  Lib     : THandle;
  Add     : Function(a, b : Integer) : Integer; Stdcall;
  PrintMe : Procedure(a : PChar); Stdcall;
Begin
  { Load the library from disk }
  Lib := LoadLibrary('./libhello.so');

  { Check for success }
  If Lib >= 32 Then 
  Begin

    { Locate add function and, if found, call it }
    Pointer(Add) := GetProcAddress(Lib, 'add');
    If Add = Nil Then
      WriteLn('Unable to find add.')
    Else
      WriteLn('The result is: ', Add(5, 6));

    { Locate the printme procedure and, if found, call it }
    Pointer(PrintMe) := GetProcAddress(Lib, 'printme');
    If PrintMe = Nil Then
      WriteLn('Unable to find printme.')
    Else
      PrintMe('Hello from Free Pascal!');

    { Clean up }
    FreeLibrary(Lib);
  End
  Else
    WriteLn('Failed to load library: ./libhello.so');
End.
Output:
The result is: 11
Hello from library: Hello from Free Pascal!