For Steam games just go to your library of games. Right click on the game, you should see 'View Game CD-Key' as the second option on the dropdown menu.
Or you can start the game. Once the game is running press Shift & Tab together, it will bring you to a Steam menu that should have a tab 'CD-Key'.
The 3rd option is to go to look for the 'View' tab at the top left of your Steam library menu. Click 'View', then 'Games Details'. Now you can click on your game in the regular library and it should show game info in the right half of the Steam application. Under the section "Links" at the far right edge there will be a link for "Cd Key