It's not a variable resistor, usually its a small microcontroller using PWM on an H-Bridge. You actually probably don't want to use an ESC (electronic speed control), as they're a little large, and usually designed for R/C usage (20+Amperes). Instead, get yourself an L293D or a SN745510, and dead-bug it for motor driver control. Almost all microcontrollers these days have PWM, and with two PWM outputs to the enable pins, you can easily mimic the functionality of an ESC. If you need help with code, just ask, although I only really know AVRs.