By default the GraphHopper import process stores only the speed and accessibility (forward+backward) information for an edge.
So, the first step will be to create a custom FlagEncoder which stores the type of the road e.g. an integer somewhere in the long/int flags. You can use the EncodedValue class for this.
The next step is to create a custom Weighting implementation which then calculates the speed from the flag information you stored. The weighting will be called while querytime so you can take into account the user its preferences, which can be changed per query.
Note: you'll need to disable CH when you allow changing the preferences for every query
Note: this change could be valuable for the core GraphHopper, so if you implement it let us know via a pull request ;)