How do I create a custom method on the server and call it from the client?

On the server, create a custom method on the Remote DataModule (RDM) by selecting
the RDM unit in the Delphi IDE and selecting the Edit | Add To Interface menu item.
In the resulting dialog, fill in the prototype of the desired procedure. For example:
  function Login(const UserName, Password: Widestring);

You can then implement the Login function in your RDM.

On the client, you call the custom method by using the AppServer property of the
TDispatchConnection. For example:
  if DCOMConnection1.AppServer.Login('sysdba', 'masterkey') then
    ShowMessage('Logged in successfully');