On Unix machines, the standard libraries for C and C++ are built as part of the base system. For instance, the FreeBSD
buildworld builds (from source) libc, the LLVM infractuture, clang++ and libc++ (among others).
http://www.freebsd.org/doc/en/books/handbook/makeworld.html
On 'distro' based implementations, these are typically pre-compiled by the maintainer of the distro, and distributed as parts of pre-built libraries.
When you downloaded Code::Blocks 13.12 along with the MinGW tool-chain, it contains the C and C++ libraries (in binary form) which were pre-built from the source code. Your installation would have <stdio.h> as a header file, but it would not have the source code for printf.c - printf.c was compiled and the resultant binary object file was placed in one or more libraries. When you call
printf(), the call is forwarded to the (binary) code from the library which your program would have linked to.