Take a look at the source code for DTLoggedExec.
In the Program.cs file there is some code that sets property values, you can probably use this in your program.
DtsProperty p;
Variable pkgObj;
pkgObj = (Variable)package.GetObjectFromPackagePath(valuePath, out p);
if (p != null && pkgObj != null)
{
Console.WriteLine(" (Parameter Type: " + pkgObj.DataType + ")");
p.SetValue(pkgObj, Convert.ChangeType(s[1], pkgObj.DataType));
}
The valuePath is the path to the object and s1 is your value you want to put into that property. For a connection manager, it usually is something like:
\Package.Connections[CONNMGRNAME].Properties[ConnectionString]