Your question is pretty broad and covers a range of technologies.
Communicating with a GSM Modem
A GSM modem will connect to a computer using a serial or USB port. You can open the serial port and talk with it. Since you didn't specify platform, I can't suggest how to do that. In c#, you would use the SerialPort class. You use the standard AT* command set for various operations with it.
Communicating with a GPRS modem
A GPRS modem connected to external device will normally be on internet. If you know the IP address of target device, you can use TCP/IP sockets for communicating with it.
I want to interface GSM/GPRS modem
with some microprocessor
Not sure what exactly you mean by that but if you want to program a processor for GPRS/GSM communication, you will need to understand that processor and write or buy a TCP/IP stack.