There are several ways of doing this, the most common is by using SSH with key authentication (no passwords).
For example, this example will print the date from the remote computer, and return you to your normal (local) prompt:
Code:
$ ssh remote.server "date"
Fri May 15 07:38:36 PDT 2009
$
If you need to capture the output, you may need to wrap the above within another script, or take a look at the `expect` scripting 'language' which can wait for remote output (e.g. password prompts) and supply data when asked.