Trim, simply put, won't. At least, if it's coming from a C program on the other side. C inserts a null string terminator, and although CLR doesn't appear to use the null-terminator as a string terminator, it does recognize it as one. No matter how you copy the contents of your array of characters into native strings, it always brings with it the underlying character array. And Trim, even if you tell it to trim off the Nothings, simply refuses to remove the last null terminator. Printing such a string out will force the printed statement to terminate prematurely.
MyString = System.Text.Encoding.ASCII.GetString(buffer)
Debug.Print("MyString ({0}) has issues.", MyString)
will print something like this...
"MyString(<buffer contents>
The null terminator embedded in MyString forces the termination of the string, dropping ") has issues." or whatever else follows. Instead of using Trim(), use Substring(0, TempStringWithNullTerminator.IndexOf(Nothing)) to copy to a temporary string. (Nothing is the VB translation of the null terminator.) This trims off the buffer the first null-terminator and onward when you copy into the string.
Hope someone else finds this helpful. Took me half a workday to figure this out and I've seen others are struggling with this. I suspect this is actually a bug in the .Net Framework that was introduced from trying to support c-style strings.