You basically do the same thing that you would normally do from an app running inside the App Server; except you do it from a remote InitialContext. Setting up a remote InitialContext is dependant on your App Server vendor.
If it's OAS I can help a bit more.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: JMS - How to connect to a QUEUE setup on some server from stand alone application?