Starting with a "clean" copy of the avrisp sketch that accompanies the Arduino IDE, port it to straight C for use without Arduino. This also gives a copy of the Arduino sketch that will remain static.