A leak in the intake can cause this -
Check your air intake, and crankcase breathers (hoses that are connected to the air intake, throttle body, inlet manifold) etc for splits.
Also, the PCV valve can get "gummed up" with oily residue,
The idle control valve can give trouble and cause these symptoms
The ECU may actually be increasing the revs (to compensate for a fault) to stop the engine stalling it may "settle down" after a while/ after the engine is warmed up (but the fault may still be there)