Basically, you have two path to choose.
- Use some third party library for SMS processing (sending/receiving)
- Write your own library, which will communicate with device using I/O (most GSM modems can communicate with PC via serial port of some sort - physical or virtual)
For obvious reasons, I recommend choosing the first part. If you look for recommendation, I can strongly recommend using SMSlib. I've been using it in one of my projects with great success, although some skills were needed to make it all work. After tedious process of installation was over, the rest (sending, receiving, creating callback services) was extremely simple and easy.
If you would like to try the second possible choice, than have a look at Nokia developers forum and Java Communications API.