As far as varying the voltage, most of the IC's have an internal voltage reference of 1.25V or similar connected to one input of the comparator internally. Lets say your device is 1.25V. You then have a voltage divider on the the other input to set the output voltage. If instead of taking the lower resistor of the divider to 0V, you take it to a variable 0 - 1.25V source, then as the voltage of this source goes from 0 - 1.25V, then the output should in theory go from maximum to zero.
I have not tried this, but it should work. Make sure the source has a capacitor decoupling across its output. If the source opamp does not like a straight 0.1uF cap on its output (starts oscillating) add a 10 ohm or bigger resistor between the source output and the capacitor.
Richard.