You can do this in one of three ways:
1. you have a GSM modem (or equevilant in non GSM networks) , GSM modems normally accept AT commands on the serial port, which is not hard to learn or develop on any languages..
2. You buy an SMPP link from any service
provider and write an implimentation for the SMPP protocol which is somehow like the TCP protocol (its actually built on top of it), acquiring a link is not a cheap solution
and providers normally provide this only for corporates with huge consumption of SMS messages.
3. Buy SMS qoutation from a web-based provider (I may suggest BulkSMS.com) that enables you from writing a software implementation to send
special requests for sending SMS messages over the internet...
If you are developing an application
to send a certain limited number of SMS messages per day (frequency less than 1 message per 20 seconds) then GSM modem will be sufficient and inexpensive.
If you are developing an application to send bulk messages (thousands per day) the you might want to consider any of the later 2 options.