WPILib has its very own comprehensive (ish) documentation on
C++ programming for robots. First you should choose which base class you're using -- IterativeRobot, SimpleRobot, or Command-based Robot. Once you have that, there are plenty of resources found in that link to get started with robot programming.