I believe Code::blocks will use any compiler you tell it to, or even a Makefile if you want, so it should be possible to use it to write your programs. To compile them and upload them you will need something similar to the Command Line options. If you are using Code::blocks on Windows then these will have to be adapted a bit and you will need to get various libraries. On Linux most of these libraries should be in your distro's repositories.
If you want to run most of your program on the PC and tell the arduino what to do you should be able to use the serial interface fairly easily. See here for details. There are common ways of using serial interfaces in both Linux and Windows which Google will find you.