Trying to get the second code sample you provided compiled and linked wasn't straight/easy (even though it doesn't use mysql++ but just the plain mysql headers).
It uses old C++ style (needs some minor fixes), winsock.h really needs to be included before mysql.h, you have to set paths for includes and libraries, be sure two DLLs are in the PATH or in the same folder as your executable (MySQL suggests to add the path for one of those in the installation process), add two libraries in the correct order so it'll be able to link, ...
It won't be such a nice experience as you would want it to, but once you're done with all those details it should work lovely with Code::Blocks
Add to the previous installation procedure:
cd c:\mysql++
install.bat opt
Now you can create a new application (a new console application would be fine), change the main.cpp it created with a sample code that uses mysql++ and add this in Project->Build options:
[Linker: Link libraries]: mysqlpp, mysqlclient (add them in that order).
[Directories: Compiler]: C:\mysql++\include, C:\mysql\include (the order doesn't matter).
[Directories: Linker]: C:\mysql++\lib, C:\mysql\lib\opt (once again, the order doesn't matter).
Now you should be ready to hit build and almost get it to run (if c:\mysql++\lib is in the PATH or you copy c:\mysql++\lib\mysqlpp.dll to your executable's directory, it should run).
Just remember any mysql++ specific problem you better discuss it in the mysql++'s forums