If you go to Microchip.com and type MSSP or SPI or I2C into the Search window, then click on Application Notes in the left column, there are numerous Application Notes on how these peripherals function, and how to put them to use. Code is usually in ASM and/or C, but the concepts are outlined extremely well.