I guess you must go through the JNI. I can't say I really know it, but it doesn't look too complicated.
What I have no clue about is how to pass low-level data (i.e. pointers) from the Max environment to your JNI functions, but according to
https://cycling74.com/forums/polyglot-class it should be possible - the interesting part is Joshua's reply of course ;)
sorry for not being very helpful...
good luck - and let me know if you find out something!!!
Unrelated but still wanted to share this: whenever you post a question in a "sub-board" it always appears on the "all" board as well. Many people go over the 'All' board before checking up on the boards of their interest (in my case 'maxmsp' and 'max for live'). So even if you post on a somewhat slow board chances are high many people see your post anyway.