In order to use the key follow the instruction below:
Go to https://www.xbox.com
Login to your account
Hover over your account link (the top right of the screen) a menu will appear, click on the "Redeem Code" button.
On the next page, click "Redeem"
Enter your code
Click "Confirm"
Click "Confirm" again to assign the key to your account.
In order to download and install your game on Windows 10 follow the instructions below:
Using your Microsoft account, sign in to the PC where you want to install your games.
On the Start screen, select the Store icon.
In the Store, select Games from the menu.
Browse and select the game you want to install.