I just found out that Mobicents has a ussd gateway and simulator . all you need to do is to checkout their source code from their SVN and "mvn clean install" the files. I didn't try it yet . But I know mobicent is a reliable program.
- this is their introduction to USSD
- this is their Google Group
- A thread on how to install ussd gateway