There are several methods:
1, conventional is to connect them to a high speed counter card. Most PLC manufacturers design their HC cards to connect to incremental encoders, so this should be easy. Just follow the instructions and make sure the encoder is compatible with the card.
2, Connect to an ordinary PLC input card, this will only work if the encoder increments slowly. I would not reccoment this method. however,I have seen it work airly well with an absolute encoder.
3, Bus Connection, I have seen encoders for most popular busses. For an S7 300 you could get an encoder for either Profibus or ASi.
There are other methods, but the above methods are the most popular and best understood.
As for programming, standard S7 programming software will work. The values are simply transmitted to a register and this can be read directly. There is also some function blocks that can convert these, but I never found I needed to use these.
Doug