In order to use the Arduino MsTimer2 library on AT90USB646 microcontroller you have to minimally modify the source code of the library. First, download the library, unpack it into the “libraries” directory of your Arduino installation (it’s a subdir of “hardware”) and open the file MsTimer2.cpp.
I wanted to use the port F in Teensy++ board as ordinary digital inputs/outputs and it turned out that there is an extra step involved to ordinary DDR stuff. I’m coding using the Teensy port of core Arduino libraries to AT90USB646 chip. After checking the chip datasheet, I found that the proper port initialization includes setting the DIDR0 register (setting desired pins of port F to digital instead of analogue). So the full initialization should look like