Use the Microsoft Visual Studio Tools for Applications (VSTA) development environment that is integrated into Microsoft Office InfoPath 2007.
EDIT
Having researched a little deeper it appears that the VSTA suppllied with Office2k7 is version 1.0 which runs .NET 2.0, I could not find any known workarounds.
You could try installing VSTA 2.0 if you can find it.
You will come across deployment problems if your target clients are running 2007 so if you really need 3.5 or 4.0 then upgrading to 2010 which uses VSTA 2.0.
Use the Microsoft Visual Studio Tools for Applications (VSTA) development environment that is integrated into Microsoft Office InfoPath 2007.
EDIT Having researched a little deeper it appears that the VSTA suppllied with Office2k7 is version 1.0 which runs .NET 2.0, I could not find any known workarounds.
You could try installing VSTA 2.0 if you can find it.
You will come across deployment problems if your target clients are running 2007 so if you really need 3.5 or 4.0 then upgrading to 2010 which uses VSTA 2.0.