This is extremely difficult to write from scratch. You have to read about all the commands the drive supports in order to send the command to the drive to initiate the burning lazer not only that you need to also understand how the CD and DVD data disc structures are layed out on disc or you will end up with a burned CD or DVD that is corrupt. To make things even more difficult the structure for a CD disc is completley different from the DVD structure so you have read about both CD and DVD structures internally which can take months to learn.
Fortunatley Microsoft has available the Image Mastering API which takes all the hard work and wraps it into a set of COM methods you can use. You will need to redistribute this for XP machines but the 2.0 version comes with Vista and later.
Burning a Disc Image (VBScript Example)
http://msdn.microsoft.com/en-us/library/aa364817(VS.85).aspx
Image Mastering API
http://msdn.microsoft.com/en-us/library/aa366450(VS.85).aspx
Using IMAPI
http://msdn.microsoft.com/en-us/library/aa366454(VS.85).aspx