diff --git a/fficxx.cabal b/fficxx.cabal
--- a/fficxx.cabal
+++ b/fficxx.cabal
@@ -1,5 +1,5 @@
 Name:		fficxx
-Version:	0.1
+Version:	0.1.0
 Synopsis:	automatic C++ binding generation
 Description: 	automatic C++ binding generation 
 License:        BSD3
@@ -15,6 +15,13 @@
             template/*.hs-boot.st
             template/*.cpp.st
             template/Pkg.cabal.st
+            sample/cxxlib/build.sh
+            sample/cxxlib/include/*.h
+            sample/cxxlib/src/*.cpp
+            sample/cxxlib/src/Makefile
+            sample/mysample-generator/MySampleGen.hs
+            sample/mysample-generator/use_mysample.hs
+
 
 Source-repository head
   type: git
diff --git a/sample/cxxlib/build.sh b/sample/cxxlib/build.sh
new file mode 100644
--- /dev/null
+++ b/sample/cxxlib/build.sh
@@ -0,0 +1,6 @@
+cd src 
+make 
+cd ..
+mkdir -p lib
+cp src/libmysample.so lib/libmysample.so 
+
diff --git a/sample/cxxlib/include/A.h b/sample/cxxlib/include/A.h
new file mode 100644
--- /dev/null
+++ b/sample/cxxlib/include/A.h
@@ -0,0 +1,12 @@
+#ifndef __A__
+#define __A__ 
+
+class A
+{ 
+public: 
+  A(); 
+  virtual void Foo( void );
+
+}; 
+
+#endif // __A__
diff --git a/sample/cxxlib/include/B.h b/sample/cxxlib/include/B.h
new file mode 100644
--- /dev/null
+++ b/sample/cxxlib/include/B.h
@@ -0,0 +1,13 @@
+#ifndef __B__ 
+#define __B__
+
+#include "A.h"
+class B : public A 
+{ 
+public: 
+  B();
+  virtual void Foo(void); 
+  virtual void Bar(void);   
+}; 
+
+#endif // __B__
diff --git a/sample/cxxlib/src/A.cpp b/sample/cxxlib/src/A.cpp
new file mode 100644
--- /dev/null
+++ b/sample/cxxlib/src/A.cpp
@@ -0,0 +1,11 @@
+#include <iostream>
+#include "A.h"
+
+
+A::A() { } 
+
+void A::Foo() 
+{ 
+std::cout << "A:foo" << std::endl;  
+} 
+
diff --git a/sample/cxxlib/src/B.cpp b/sample/cxxlib/src/B.cpp
new file mode 100644
--- /dev/null
+++ b/sample/cxxlib/src/B.cpp
@@ -0,0 +1,15 @@
+#include <iostream>
+#include "B.h"
+
+B::B() { } 
+
+void B::Foo( void ) 
+{
+  std::cout << "B:foo" << std::endl;  
+}
+
+void B::Bar( void ) 
+{ 
+  std::cout << "bar" << std::endl ; 
+} 
+
diff --git a/sample/cxxlib/src/Makefile b/sample/cxxlib/src/Makefile
new file mode 100644
--- /dev/null
+++ b/sample/cxxlib/src/Makefile
@@ -0,0 +1,9 @@
+libmysample.so: A.o B.o 
+	gcc -shared -Wl,-soname,libmysample.so -o libmysample.so A.o B.o 
+
+A.o: A.cpp
+	g++ -fPIC -I../include -c A.cpp 
+
+B.o: B.cpp
+	g++ -fPIC -I../include -c B.cpp 
+
diff --git a/sample/mysample-generator/MySampleGen.hs b/sample/mysample-generator/MySampleGen.hs
new file mode 100644
--- /dev/null
+++ b/sample/mysample-generator/MySampleGen.hs
@@ -0,0 +1,149 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+
+import Data.Monoid (mempty)
+import System.FilePath ((</>))
+import System.Directory (getCurrentDirectory)
+import           Text.StringTemplate hiding (render)
+-- 
+import           FFICXX.Generate.Code.Cabal
+import           FFICXX.Generate.Code.Cpp
+import           FFICXX.Generate.Code.Dependency
+import           FFICXX.Generate.Config
+import           FFICXX.Generate.Code.Cpp
+import           FFICXX.Generate.Code.Dependency
+import           FFICXX.Generate.Config
+import           FFICXX.Generate.Generator.ContentMaker 
+import           FFICXX.Generate.Generator.Driver
+import           FFICXX.Generate.Type.Annotate
+import           FFICXX.Generate.Type.Class
+import           FFICXX.Generate.Type.PackageInterface
+import           FFICXX.Generate.Util
+-- 
+import qualified FFICXX.Paths_fficxx as F
+
+mysampleclasses = [ ] 
+
+mycabal = Cabal { cabal_pkgname = "MySample" 
+                , cabal_cheaderprefix = "MySample"
+                , cabal_moduleprefix = "MySample" }
+
+myclass = Class mycabal 
+
+a :: Class 
+a = myclass "A" [] mempty 
+    [ Constructor [] 
+    , Virtual void_ "Foo" [ ] 
+    ] 
+
+b :: Class 
+b = myclass "B" [a] mempty 
+    [ Constructor [] 
+    , Virtual void_ "Bar" [] 
+    ] 
+
+myclasses = [ a, b] 
+
+
+-- | 
+cabalTemplate :: String 
+cabalTemplate = "Pkg.cabal"
+
+
+-- | 
+mkCabalFile :: FFICXXConfig
+            -> STGroup String  
+            -> [ClassModule]
+            -> FilePath  
+            -> IO () 
+mkCabalFile config templates classmodules cabalfile = do 
+  cpath <- getCurrentDirectory 
+
+  let str = renderTemplateGroup 
+              templates 
+              [ ("pkgname", "MySample") 
+              , ("version",  "0.0") 
+              , ("license", "" ) 
+              , ("buildtype", "Simple")
+              , ("deps", "" ) 
+              , ("csrcFiles", genCsrcFiles classmodules)
+              , ("includeFiles", genIncludeFiles "MySample" classmodules) 
+              , ("cppFiles", genCppFiles classmodules)
+              , ("exposedModules", genExposedModules "MySample" classmodules) 
+              , ("otherModules", genOtherModules classmodules)
+              , ("extralibdirs", cpath </> ".." </> "cxxlib" </> "lib" )  -- this need to be changed 
+              , ("extraincludedirs", cpath </> ".." </> "cxxlib" </> "include" )  -- this need to be changed 
+              , ("extralib", ", mysample")
+              , ("cabalIndentation", cabalIndentation)
+              ]
+              cabalTemplate 
+  writeFile cabalfile str
+
+
+
+
+main :: IO ()
+main = do 
+  putStrLn "generate mysample" 
+  cwd <- getCurrentDirectory 
+
+  let cfg =  FFICXXConfig { fficxxconfig_scriptBaseDir = cwd 
+                          , fficxxconfig_workingDir = cwd </> "working"
+                          , fficxxconfig_installBaseDir = cwd </> "MySample"  
+                          } 
+      workingDir = fficxxconfig_workingDir cfg
+      installDir = fficxxconfig_installBaseDir cfg 
+      pkgname = "MySample" 
+      (mods,cihs) = mkAllClassModulesAndCIH ("MySample", (\c->([],[class_name c ++ ".h"]))) myclasses
+      hsbootlst = mkHSBOOTCandidateList mods 
+      cglobal = mkGlobal myclasses 
+      summarymodule = "MySample" 
+      cabalFileName = "MySample.cabal"
+  templateDir <- F.getDataDir >>= return . (</> "template")
+  (templates :: STGroup String) <- directoryGroup templateDir 
+  -- 
+  notExistThenCreate workingDir
+  notExistThenCreate installDir 
+  notExistThenCreate (installDir </> "src") 
+  notExistThenCreate (installDir </> "csrc")
+  -- 
+  putStrLn "cabal file generation" 
+  mkCabalFile cfg templates mods (workingDir </> cabalFileName)
+  -- 
+  putStrLn "header file generation"
+  writeTypeDeclHeaders templates workingDir (TypMcro "__MYSAMPLE__") pkgname cihs
+  mapM_ (writeDeclHeaders templates workingDir (TypMcro "__MYSAMPLE__") pkgname) cihs
+  -- 
+  putStrLn "cpp file generation" 
+  mapM_ (writeCppDef templates workingDir) cihs
+  -- 
+  putStrLn "RawType.hs file generation" 
+  mapM_ (writeRawTypeHs templates workingDir) mods 
+  -- 
+  putStrLn "FFI.hsc file generation"
+  mapM_ (writeFFIHsc templates workingDir) mods
+  -- 
+  putStrLn "Interface.hs file generation" 
+  mapM_ (writeInterfaceHs mempty templates workingDir) mods
+  -- 
+  putStrLn "Cast.hs file generation"
+  mapM_ (writeCastHs templates workingDir) mods
+  -- 
+  putStrLn "Implementation.hs file generation"
+  mapM_ (writeImplementationHs mempty templates workingDir) mods
+  -- 
+  putStrLn "hs-boot file generation" 
+  mapM_ (writeInterfaceHSBOOT templates workingDir) hsbootlst  
+  -- 
+  putStrLn "module file generation" 
+  mapM_ (writeModuleHs templates workingDir) mods
+  -- 
+  putStrLn "summary module generation generation"
+  writePkgHs summarymodule templates workingDir mods
+  -- 
+  putStrLn "copying"
+  copyFileWithMD5Check (workingDir </> cabalFileName)  (installDir </> cabalFileName) 
+  -- copyPredefined templateDir (srcDir ibase) pkgname
+  mapM_ (copyCppFiles workingDir (csrcDir installDir) pkgname) cihs
+  mapM_ (copyModule workingDir (srcDir installDir) summarymodule) mods 
+
+
diff --git a/sample/mysample-generator/use_mysample.hs b/sample/mysample-generator/use_mysample.hs
new file mode 100644
--- /dev/null
+++ b/sample/mysample-generator/use_mysample.hs
@@ -0,0 +1,15 @@
+import MySample
+
+main :: IO ()
+main = do 
+  a <- newA 
+  b <- newB 
+  
+  foo a 
+  foo b 
+
+  foo (upcastA b) 
+
+  bar b 
+
+
