w/r/t: Swampboy's followup...
Well 3-1-1 tells you the consequences...
If the umpire realizes it before allowing the CR - which he should because he's supposed to keep track on his handy, dandy, lineup card - then just disallow the CR. That'd be called preventative umpiring. If the player gets into the game and then it's brought to the attention of the umpire by the opposing coach or (unlikely, but possible) the coach on offense, apply the consequences by rule. It'll be the last time it happens I would think!
Penalty is being called out and restricted to the bench/dugout for the duration of the game of the player.... If a restricted player tries to enter the game - he's out and ejected.
The aspect of handling things after discovery of an illegal player once a pitch is made to either team is at best confusing in reading the rule. Unlike batting out of order an illegal sub doesn't become magically legal after a pitch. The only thing the next pitch does is create/cause mayhem and make life more difficult for the umpire :-). Hence why you do preventative umpiring. Assume CR goes to 1B, ball is put back in play, pitcher attempts pickoff and it's a wild throw. CR ends up at third and runner on third scores and *then* the illegal sub is recognized before the next pitch. Call the CR out, restrict him to the dugout, and replace the runner that scored on 3rd. Hopefully you can do all this before the infielders leave the diamond on the last out of the game especially if he's the 3rd out of a tie game...