Hi Mechman,
I am sure there are many ways to do this but with a quick search on voltage to frequency converters i found this chip which will do what you want
LM2917 - Frequency to Voltage Converter
on page 8 it even has a circuit for a speed switch so it looks like exactly what your after.
good luck