I am not aware of any public codes relating to the solution of your problem. You might have to piece several parts together and conduct your own experiment.
For the first part, computing the displacement from a normal map, his is typically done by integrating the normal map. You might be able to find some codes online. If you assume your normal map is a normal map of half a sphere, you can do some simple calculations. Basically the normal vector at each texel can be used as the displacement (you just need to scale it appropriately).
For the second part, you need to adjust the texture coordinates of each pixel in the 2D plane according to the displacement. For this, you can study the parallax mapping codes in the Microsoft DX9 SDK samples (or any parallax mapping codes you can find online).
Good luck!