There are a few ways to fit a speed limiter, but it depends on the actual controller you've got. Some have three speed switch wires, which may well make fitting a switch fairly straightforward, some have a speed limiter link, which is again pretty easy to connect up to limit the speed and some might need to be modified by tinkering with the throttle voltage (not that easy unless you're happy with breaking into wiring and soldering in some components).
A bit more info on your controller would help.
BWT, even with a speed limiter switch the bike will still be just as illegal.