Put it in a file named something like "ParseBBCode.h". Include that header in your Form1.h file (or put it in stdafx.h, but that's not necessary). You do not need to include <string>, the String ^ in this case is a System::String^ from .NET.
You will either need to put a using namespace System;
at the top of your header (not a good idea, as everything that includes it will now have that namespace) or qualify your String^s in the header as such:
System::String ^ ParseBBCode(System::String^ OriginalText);