Comparator over I2C with programmable reference
Have you considered using a fixed voltage reference in conjunction with a I2C digital pot, for example the Analog Devices ADC5258.

As mikeselectricstuff has pointed out, this functionality is actually built into many PICs.