Under Windows, you want to use either RAS, which is pretty high level and easy, or TAPI, which is harder but gives you more control and information.
VC++ comes with sample code for both, those will get you going in the right direction. If this isn't Windows, then someone else can chime in on how to get started...