You need an operator & function set to go with the type.
This is a small set to illustrate:
type MyUdt
double x,y
end type
macro MyUdt_op
'
macro ."load" (acc,a) 'mandatory
acc.x=a.x
acc.y=a.y
end macro
'
macro ."+" (acc,a)
acc.x+=a.x
acc.y+=a.y
end macro
'
macro ."save" (a,acc) 'mandatory
a.x=acc.x
a.y=acc.y
end macro
'
macro ."foo" (z)
z.x = 123
z.y = 34
end macro
'
macro ."import" (z,a,b)
z.x = a
z.y = b
end macro
'
macro ."str" string (s,z)
s=str(z.x)+", "+str(z.y)
end macro
'
end macro
'myudt v=foo()
'dim myudt v=foo()
dim as myudt v=foo()
'dim v as myudt = foo() 'not working
print v.y
'
myudt va,vb,vc
va=foo()
vb=va+va
print vb.y '68
'
vc=foo()+foo()+va
print vc.y '102
'
vc=va+import(1000,100)
print vc.y '134
'
print ""+str(vc) '1123,134
'