This post is a record of the way I got flex and bison going on MinGW.

Firstly let me prefix this by saying that although mingw and msys are a great idea, and much better than I remember them to be, getting everything running is much harder than it should be.

1. Download and the core mingw installer from the sourceforge page (follow the links on the MinGW download page)
MinGW-5.1.4.exe

2. Add c:\mingw\bin to your path

3. On the sourceforge download page, under the category MSYS base system, open ‘current-release’ and download the MSYS installer.
MSYS-1.0.10.exe

4. Add c:\msys\1.0\bin to your path

5. Download the flex and bison packages, making sure not to get the source packages. You only need the executables from those packages and put them in the somewhere in your path (c:\mingw\bin seemed reasonable).