Now, load up the Discovery demo code.
1) download the discovery demo package from st.com.
2) unzip it and you will find a few folders. One is called Libraries - it contains CMSIS core and the std periph functions. CoIDE has done that for you.
We need content from two folders:
a) Project: navigate to Project -> Demo, copy all the files under src (main.c and stm32f10x_it.c) and inc (stm32f10x_conf.h and stm32f10x_it.h) to your project directory.
b) Utilities: it contains two files for the discovery board, stm32vldiscovery.h and stm32vldiscovery.c. Copy them to your project directory.
3) You will need to add those new files to your project. In the left middle of the screen, there is a little tab called "Project", showing your project and its content. Right click on your project name, and select "Add Files". Navigate to your project folder and you will see those files mentioned in step 2. Select them all: use Ctrl-Click.
Now all the files will be visible in the "Project" tab / window.
4) you are almost there,
4.1) click on stm32vldiscovery.h, insert, right below [#include "stm32f10x.h"], [#include "stm32f10x_conf.h"];
4.2) click on stm32f10x_conf.h, find __STM32F10x_CONF_H: it shows up on lines 22 and 23. Delete one leading underscore (so you have _STM32F10x_CONF_H).
5) hit compile and you are done. The resulting code can be downloaded into the board and it will run.
Step 4) above actually isn't necessary, if you do two things:
a) in step 3), do NOT copy stm32f10x_conf.h from the Demo folder;
b) in CoIDE, navigate to cmsis_boot->stm32f10x_conf.h, and uncomment those lines so that the stm32f10x_conf.h under cmsis_boot is identical to the stm32f10x_conf.h in the demo folder.
The right way, once you know your way around, is to modify the stm32f10x_conf.h (which configures the std periph library) to suit your project's needs.