Many of us have done this but for professional reasons we are unable or unwilling to share the code. However, Robert Soubie detailed his adventures with I2CSlave using Melabs PICBasic, and posted all his code here...

http://www.astrosurf.com/soubie/pic_as_an_i2c_slave.htm

Well done Robert!