I would suggest using the standard peripheral libraries and example projects which can be found on the ST website, unless you have a requirement such as mine where you cannot use those libraries.
Just to add a close to this post I found a number of issues with the I2C peripheral hardware which can be found in the errata sheet (Link Below).
The issues were relating to the timing and handling of retrieving data from buffer and so I had to handle the transmission and reception of all data within the I2C interrupt. A useful example project for which can be found in the second link below.