Given the recent interest in automation, find below a comprehensive discussion of the topic. It's by Tom Howe, and although it dates from 1998 (i was there i think), it's still hard to beat, and includes some top code samples.
(If you search for Tom Howe and Automation I'm sure you'll find more recent stuff.)
http://www.microsoft.com/officedev/ARTICLES/MOVS211.HTM
(If you search for Tom Howe and Automation I'm sure you'll find more recent stuff.)
http://www.microsoft.com/officedev/ARTICLES/MOVS211.HTM