I realized that the Sparkfun page I linked to is not actually a MAX232 circuit - you might want to use one that is a real MAX232 as some people report problems with the Sparkfun adaptor.
You can look at my code here (the Train Control sketch) to see how I did the TMCC buffer thing - it's at the top of the _interface tab. But I am afraid the code is very complex and probably not too easy to understand. It also depends on some libraries that are in the libraries folder.
I am reading the state of DZ-2500 switch machines by tapping into the line that normally lights red or green LEDS on the pushbutton controller. If I recall correctly, I stuck a few diodes in series with that line, and fed it into an optocoupler. That gave me a logic level signal representing the state of the switch machine. But that may be getting more complex than you want to try at first.