Yes can be done - see http://www.arduino.cc/en/Tutorial/AnalogInputPins - While the main function of the analog pins for most Arduino users is to read analog sensors, the analog pins also have all the functionality of general purpose input/output (GPIO) pins (the same as digital pins 0 - 13).
use digitalRead() and digitalWrite() pinnumbers are 14-19