InfoPath is a great tool in the VSTO toolkit. There are two ways you can write managed code behind an InfoPath form. First, you can use Visual Studio Tools for Applications which ships on the Office CD with InfoPath 2007. VSTA provides a nice integrated experience and may remind you of the VBA experience of putting code behind things. VSTA is a slimmed down version of Visual Studio that has been optimized for integration into applications that need a customization or extension experience. In particular, VSTA does a lot for applications written in managed code as it provides a versioning resilience story for these applications so that a customization for the application can version independently of the application itself. This is fancy talk for saying that VSTA provides a solution so customizations written for your application won't break when you rev the object models they are written against.
You can also use the full VSTO experience which brings InfoPath forms right into Visual Studio using InfoPath 2007 and VSTO 2005 Second Edition.
This "In-Situ" VSTO editing experience is much improved in InfoPath 2007 and VSTO 2005 SE. I complained a little about the InfoPath 2003 in VSTO experience in my book because it forced you to switch back and forth between the Visual Studio window and the InfoPath window. But in InfoPath 2007 it is just like the VSTO experience of editing a Word or Excel document inside of Visual Studio. The InfoPath team really nailed it.
There are some new articles available about InfoPath 2007 for developers that you might want to check out here.
Also, Hagen Green and Scott Roberts recently published a book on InfoPath 2007 form development in the Addison Wesley .NET series that I just got a copy of and it looks very good. Hagen wrote the InfoPath chapter in my book on VSTO. Hagen and Scott's new book is described here