There are several examples of IFC4 files that comply to the published release candidates of IFC4 already. Reference to IFC 4 examples are now also part of the official IFC specification:
In addition, you find here two examples of IFC4 files
Above examples are written in C/C++ and can be opened with Visual Studio 6, VS2005 and converted to all new Visual Studio environments. All source code is free to be used and changed for commercial and non-commercial purposes (the used toolbox is only free in non-commercial projects but also can be exchanged with other toolboxes).
Currently those example files are only available as *.ifc files (using P21 file structure), examples for *.ifcxml files (using XML file structure) are upcoming.