Check out the Velocity PID (2012) located here:
http://www.fightingpi.org/Controls.html
It's in labview, and is commented fairly well and should be self explanatory if you know basic PID theory. Thanks to Jared from team 341 for giving the derivation in 2009 that we used to create this PID to control our shooter this year.