The problem you're going to run into is that there is no 'standard' CP/M code. Every different system uses a different BIOS, and that code (& any commentary on it) will have to come from the hardware's manufacturer. Some manufacturers supplied the source, and some didn't (good luck). As for the other parts of the code, (BDOS, CCP), the DR manuals contain the well-commented source. There are also websites where these can be d/l.
As for general reference books, the ones Lawrence mentioned are both excellent. Waite's CP/M Bible, and it's companion volume, Soul of CP/M are great for beginner-to-intermideate level, and The Programmer's CP/M Handbook, by Andy Johnson-Laird is a very advanced work. There are a few other books that land somewhere in between, but those are some of the best to get you started with hacking CP/M.
--T