In MPLAB X IDE search for icsp programming. In Circuit Serial Programming
MicroControlUnits can often be programmed using ICSP.
Examples of ICSP usage
tutorial on ICSP
A subproject of regaining control of the Freetronics Cube is to treat the Cube as a Leonardo. The Cube could be programmed using ICSP techniques.