Can someone point me in the right direction for information/example of writing a resource adapter?

I checked the Sun example, and an IBM paper, but these concentrate more on how to use a Resource Adapater, rather than write one.

I have a C++ app that I would like to make requests to from my EJB tier. I want to know how much help the JCA gives with handling the resource pooling. I would like to have various instances of my C++ app running depending on the resource load.

Am I on the right track to llok at using JCA for this?