You didn't mention what your PIC16F877 will be talking to. Your expander board will need something to convert serial data from your PIC to hardware control. Once you have that decided, you must create your own communication protocol. I would recommend each I2C transmission constitute 2 BYTEs of data; 1st BYTE designates PORT (A, B, C, or D) with 2nd BYTE containing the PORT value. On the sending end, 1st BYTE may be $01 for PORTA, $02 for PORTB, etc. Second byte would be the data; $0F turns ON the lower 4 LEDs. A command "I2CWRITE DP, CP, cont, add, [$01, $0F]" would tell your expander board to light up the lower 4 outputs of the equivalent of PORTA. On the receive end, a SELECT CASE Byt1 can filter through the 1st byte; CASE IS = $01 : OutPortA = Byt2 : CASE IS = $02 : OutportB = Byt2 and so forth.

This isn't copy/paste code, but hopefully guides you in the right direction.