I'm trying to think if there is a way to do this without code, and I can't think of one. At the very least, you'd need code in the Loading Event for Form B (the form opened from the main form) if you are passing in input parameters (http://formlibrary/template.xsn?foo=1&bar=2). And then you'd need to create the address of the form to open using a field from Form A. At that rate, the least complex solution might be to use the NewFromFormTemplate Method. MSDN has more information on that here. Here is also a C# code sample that may help you (an MSDN example that I've expanded slightly). Please note that this sample has no error handling and is written using the InfoPath 2007 Object Model.
// Create an in-memory XML document.
XmlDocument newDoc = new XmlDocument();
//Get the value of the field that contains the data you want to pass to the new document
XPathNavigator source = this.MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Data", NamespaceManager);
//Load xml into the in memory XML document. Don't forget to get the correct namespace for the form you want to load
newDoc.LoadXml(
"<?xml version=\"1.0\" encoding=\"utf-8\" ?><my:myFields xmlns:my=\"http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-07-21T15:40:24\"><my:field1>" + source.Value + "</my:field1></my:myFields>");
// Create an XPathNavigator for the XML file.
XPathNavigator newDocNav = newDoc.CreateNavigator();
// Call NewFromFormTemplate to open new form and load XML.
XmlForm newDocument =
this.Application.XmlForms.NewFromFormTemplate(
@"C:\SupportingForm.xsn", newDocNav);