There are many variables, but much of your system can be measured empirically with a cars internal sensors and OBD-II system (or possibly manufactures data, but I wouldn't hold my breath). For RPM there are two scenarios you would have to independently model; clutch engaged and clutch disengaged.
Clutch engaged: As hazzey mentioned in the comments, the engine will turn at a gear ratio of the wheel speed. Take your RPM and put it into the torque curve(for your given throttle position) to give you torque. Torque times your gear ratio and tire radius gives you force. Then solve F=MA with the mass of the vehicle to give you acceleration. Then use the kinematic equation v=a*t+v0 to solve for your new velocity based on your current velocity and time step. Which then is used to calculate your new RPM... and so goes the iteration. Similarly you could solve it with kinetic energy equations instead.
Clutch disengaged: This case can be modeled by considering energy input and internal friction of the engine. When you stop pressing on the gas, even without the wheels on the ground, the system will slow down. You could measure this for a particular car empirically by graphing RPMs when throttle input is removed. The only difference between the wheels off the ground and the clutch disengaged is the amount of inertia or kinetic energy that is stored in the spinning system and additional friction imposed by the other spinning components. This could also be determined empirically.
Take RPM to the torque curve(for your given throttle position) which gives you torque.
Torque * RPM = power input to the free spinning engine.
Power input = internal friction + kinetic energy
Internal friction is calculated from an empirical curve based on RPM. Then solve for kinetic energy input. Then use the moment of inertia (found empirically for a specific engine) to solve for your new RPM... put that back in again and iterate.
Note that the engine friction is still obviously present in the clutch engaged model as well, but is probably insignificant compared to other forces and coefficients (drag for example). Its usually best to get the model running in a simple mode first. You can always increase the accuracy of your model later if necessary. Every where I say "empirically" can be replaced by a fudge factor(an assumed/guessed coefficient) for initial model testing. For a highly accurate model however you will need highly accurate data.