how to describe logic

Dear Users,

I am working on VC++ using OpenGL API.In my project i have to describe the logic
between states.When ever an event is performed there should be a state transition
and an action.Like this there are many states and many state transitions.

Can anyone suggest me a good logic for implementing this.Are there any free libraries
for doing this.

can anyone please give links where i can get code relevant to this.

Your comments and suggestions will be much appreciated.

Thanks in advance