This episode talks about how to use both quadrature encoders and shift registers in your projects as well as offering some examples and application ideas. BASIC Stamp Source Code is available for download.
NOTE: This episode of Savage///Circuits TV contains historical information that is technically no longer accurate. The website has changed much since this video.
Probably the easiest way to get started with shift registers on the BASIC Stamp would be to download the StampWorks manual from the Parallax website and follow Experiment #23 (74HC595), Experiment #24 (74HC165) and Experiment #25 (Mixed I/O using both ICs). The code is available from the link below. The manual is available free in PDF format from the link below.
Once you've mastered shift registers (or at least understand them a little better) a more advanced example of using them can be found in the Binary / Digital Clock project. In this project several SPI devices are used and I/O pins are minimized by sharing the clock/data lines.